Skip to content

Add composable index template support - #7

Merged
jayjfletcher merged 1 commit into
mainfrom
feature/index-templates
Nov 9, 2026
Merged

jayjfletcher merged 1 commit into
mainfrom
feature/index-templates

Conversation

@jayjfletcher

Copy link
Copy Markdown
Member

Summary

  • putIndexTemplate(), getIndexTemplate(), indexTemplateExists() and deleteIndexTemplate() on Stretch and ClientContract, implemented in ElasticsearchClient and exposed on the facade.
  • An index created later whose name matches a template's index_patterns gets the template's settings, mappings and aliases. This includes an index Elasticsearch auto-creates on a bulk write.

Why

The app's order and quote exports write to yearly indices (orders-v3-2026, ...) created on first write. A template means no code has to create next year's index ahead of time. The template also carries the read alias, so new years join it automatically.

Testing

vendor/bin/pest: 337 passed. New coverage is in tests/Feature/StretchTest.php.

🤖 Generated with Claude Code

putIndexTemplate(), getIndexTemplate(), indexTemplateExists() and
deleteIndexTemplate() on Stretch and ClientContract. An index created
later whose name matches a template's index_patterns, including one
Elasticsearch auto-creates on a bulk write, gets the template's
settings, mappings and aliases.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jayjfletcher
jayjfletcher merged commit d07d25e into main Nov 9, 2026
8 checks passed
@jayjfletcher
jayjfletcher deleted the feature/index-templates branch November 11, 2026 04:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant